refactor(components): reduce post-migration TypeScript errors#10356
Conversation
| } | ||
| } | ||
|
|
||
| private setContainerEl = (el: HTMLDivElement): void => { |
There was a problem hiding this comment.
Never read, thus removed
| @State() private localeData: DateLocaleData; | ||
|
|
||
| private startInput: HTMLCalciteInputElement; | ||
| private startInput: HTMLCalciteInputTextElement; |
There was a problem hiding this comment.
This was causing a type error in Lumina - the ref is assigned to calcite-input-text, but the type here was calcite-input.
|
|
||
| guid = `calcite-tooltip-${guid()}`; | ||
|
|
||
| hasLoaded = false; |
| } | ||
|
|
||
| private getEffectiveRole(): string { | ||
| return this.el.getAttribute("role") || "menubar"; |
|
I think Firefox ESR prevents us from using ARIA-related properties (e.g., @dasa does this seem accurate to you? Sidebar: noticed |
|
We're planning to only support ESR 128 in our next release: https://whattrainisitnow.com/release/?version=esr |
jcfranco
left a comment
There was a problem hiding this comment.
Thanks for the PR, @maxpatiiuk!
Along the same lines of #10352, since some additional refactors were made to files unrelated to simplifying reflected attribute accesses, can you either:
- separate non-Host-related refactors to a separate PR?
- update the PR title to convey all PR changes?
Thanks!
|
Thanks for chiming in, @dasa! |
@jcfranco so if the next release of JS API will drop Firefox 115 ESR support, is Calcite going to do the same for Calcite 3.0 release? |
`Tag` and `childElType` are the same in Stencil, but will be different in Lit - so we should use `childElType` in places where the string check is needed.
2305e01 to
a73a79d
Compare
| delete props.level; | ||
|
|
||
| return ( | ||
| <HeadingTag class={props.class} key={props.key} level={props.level}> |
There was a problem hiding this comment.
level prop doesn't seem to exist in the DOM?
was it used for styling or testing? if not, we should remove it
original discussion in #10352 (comment)
| */ | ||
| download={ | ||
| Tag === "a" ? (download === true || download === "" ? "" : download || null) : null | ||
| childElType === "a" |
There was a problem hiding this comment.
As per line 103 in this file (const Tag = childElType;), Tag and childElType variables have the same value in Stencil - thus this change should have no runtime impact.
However, in Lit, Tag function has a bit different type to comply with Lit's dynamic tag name syntax.
See Lumina's docs on JSX -> Dynamic tag names for more details
Sorry for not clarifying earlier. We should be good to use ARIA properties. |
jcfranco
left a comment
There was a problem hiding this comment.
Awesome stuff, @maxpatiiuk! Thanks! 🚀
…tracking * origin/dev: (40 commits) feat: add parcel parameter (#10384) feat(alert): apply --calcite-alert-corner-radius to internal close button (#10388) feat(dialog, panel): Add css properties for background-color (#10387) fix: remove aria-disabled from components where necessary (#10374) feat(action-group, block, panel): add `menuPlacement` and `menuFlipPlacements` properties (#10249) fix(list, filter): fix sync between list items and filtered data (#10342) feat(popover): apply component tokens to arrow (#10386) feat(list-item): add `unavailable` property (#10377) fix(segmented-control): honor appearance, layout and scale when items are added after initialization (#10368) fix(action-pad): fix horizontal action group alignment (#10359) fix(combobox): selection-mode="single-persist" correctly selects an item when items have same values (#10366) fix(input-time-zone): fix region mode labeling and value mapping (#10345) fix(dropdown): open dropdown on `ArrowDown` & `ArrowUp` keys (#10264) refactor(components): reduce post-migration TypeScript errors (#10356) refactor: do not use Host in functional components (#10352) refactor(tests): reduce TypeScript errors (#10344) feat(alert): add component tokens (#10218) fix(card): properly handle slotted elements (#10378) refactor(panel): remove duplicate tailwind class (#10379) feat(popover, action): add component tokens (#10253) ...
…estone-estimates * origin/dev: (29 commits) fix(input-time-zone): fix region mode labeling and value mapping (#10345) fix(dropdown): open dropdown on `ArrowDown` & `ArrowUp` keys (#10264) refactor(components): reduce post-migration TypeScript errors (#10356) refactor: do not use Host in functional components (#10352) refactor(tests): reduce TypeScript errors (#10344) feat(alert): add component tokens (#10218) fix(card): properly handle slotted elements (#10378) refactor(panel): remove duplicate tailwind class (#10379) feat(popover, action): add component tokens (#10253) chore(t9n): add translations (#10339) feat: add 3d building, 3d building parameter, divide, parcel, spaces, spaces parameter, square brackets x, n variable, zoning parameter (#10373) build: update browserslist db (#10370) ci: resolve husky pre-push and pre-commit errors (#10365) docs: update component READMEs (#10371) feat(text-area): add component tokens (#10343) fix(action): prefer `disabled` in favor of `aria-disabled` (#10367) docs(a11y): add reference to a11y guidance to issue template (#10372) chore(action): add new string for accessible indicator label (#10360) feat(chip): add component tokens (#10179) feat(avatar): add component tokens (#10280) ...
Minor refactor - some HTML attributes are reflected to properties.
Thus, we can access properties instead of calling getAttribute/hasAttribute.
Properties are also more type-safe (where as getAttribute string parameter does not have type-checking)
And other minor changes.